package com.example.myapplication.util;

import android.app.Activity;
import android.content.Context;
import android.view.Display;

import androidx.annotation.NonNull;

public class ScreenUtils {

    public static int getScreenWidth(@NonNull Context context) {
        if (context instanceof Activity) {
            Display defaultDisplay = ((Activity) context).getWindowManager().getDefaultDisplay();
            return defaultDisplay.getWidth();

        }
        return 0;
    }
}
